package view
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.text.TextField;
	
	public class ImageBtn extends Sprite
	{
		[Embed(source="assets/navigation/Btn.png")]
		private var imgCls:Class;
		
		private var bgBitmap:Bitmap;
		private var txt:TextField;
		public function ImageBtn(text:String)
		{
			init();
			this.buttonMode = true;
			txt.htmlText = "<p align='center'><b><a href='event:myText'>" + text + "</a></b></p>";
		}
		private function init():void{
			bgBitmap = new imgCls();
			this.addChild(bgBitmap);
			
			txt = new TextField;
			txt.width = bgBitmap.width;
			txt.y = 5;;
			this.addChild(txt);
			txt.textColor = 0x6c5939;
			txt.selectable = false;
			this.addChild(txt);
		}
		public function set label(text:String):void{
			txt.htmlText = "<p align='center'><b><a href='event:myText'>" + text + "</a></b></p>";
		}
	}
}